package com.lzx.iteam;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.lzx.iteam.adapter.PayToolsAdapter;
import com.lzx.iteam.base.FindViewById;
import com.lzx.iteam.base.MyBaseActivity;
import com.lzx.iteam.bean.PayToolsData;

import java.util.ArrayList;

import static android.R.attr.id;

/**
 * Created by Megan on 16/9/18.
 */
public class PayToolsActivity extends MyBaseActivity implements View.OnClickListener {

    @FindViewById(id = R.id.title_tv_right)
    private TextView mTvRight;
    @FindViewById(id = R.id.title_tv_center)
    private TextView mTvTitle;
    @FindViewById(id = R.id.title_ll_back)
    private LinearLayout mLayoutBack;
    @FindViewById(id = R.id.lv_pay_tools_list)
    private ListView mLvListView;
    private PayToolsAdapter mAdapter;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState, R.layout.pay_tools_layout);
    }


    @Override
    public void initListener() {
        mLayoutBack.setOnClickListener(this);
    }

    @Override
    public void initData() {
        mTvTitle.setText("付费工具");
        mTvRight.setVisibility(View.GONE);
        ArrayList<PayToolsData> payToolsDatas = new ArrayList<PayToolsData>();
        PayToolsData payToolsData1 = new PayToolsData();
        payToolsData1.setName("员工数量升级");
        payToolsData1.setPrice("¥99");
        payToolsData1.setType("0");
        payToolsData1.setDescription("升级增加100人");
        payToolsDatas.add(payToolsData1);
        PayToolsData payToolsData2 = new PayToolsData();
        payToolsData2.setName("考勤成员升级");
        payToolsData2.setPrice("¥99");
        payToolsData2.setType("1");
        payToolsData2.setDescription("升级增加100人");
        payToolsDatas.add(payToolsData2);
        PayToolsData payToolsData3 = new PayToolsData();
        payToolsData3.setName("连锁店考勤点升级");
        payToolsData3.setPrice("¥49");
        payToolsData3.setType("2");
        payToolsData3.setDescription("升级增加5个");
        payToolsDatas.add(payToolsData3);
        PayToolsData payToolsData4 = new PayToolsData();
        payToolsData4.setName("外勤功能开通");
        payToolsData4.setPrice("¥9");
        payToolsData4.setType("3");
        payToolsData4.setDescription("升级开启外勤功能");
        payToolsDatas.add(payToolsData4);

        mAdapter=new PayToolsAdapter(this);
        mAdapter.bindData(payToolsDatas);
        mLvListView.setAdapter(mAdapter);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.title_ll_back:
                finish();
                break;
        }
    }
}
